<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/

Route::get('/', function () {
    return redirect('/blog');
});

Route::get('blog', 'BlogController@index');
Route::get('blog/{slug}', 'BlogController@showPost');



Route::resource('badmin','BadminController');
Route::resource('order','OrderController');



// Admin area
Route::get('admin', function () {
    return redirect('/admin/post');
});

Route::group(['namespace' => 'Admin', 'middleware' => 'auth'], function () {
    Route::resource('admin/post', 'PostController');
    Route::resource('admin/tag', 'TagController');
    Route::get('admin/upload', 'UploadController@index');
});

// Logging in and out
Route::get('auth/login', 'Auth/AuthController@getLogin');
Route::post('auth/login', 'Auth/AuthController@postLogin');
Route::get('auth/logout', 'Auth/AuthController@getLogout');











Auth::routes();

Route::get('/home', 'HomeController@index');
